package com.itheima.ydd.common;

/**
 * 返回结果封装
 *
 * @param <T>
 */
public class Result<T> {

    private Integer errno;

    private String errmsg;

    private T data;




    public static <T> Result<T> success(T object) {
        Result<T> result = new Result<>();
        result.errmsg = "";
        result.errno = 0;
        result.data = object;
        return result;

    }

    public static <T> Result<T> error(String msg) {
        Result<T> result = new Result<>();
        result.errno = 1000;
        result.errmsg = msg;
        return result;
    }


}
